Page({
  data: {
    // 轮播数据
    swipeList: [
      { text: "底妆口碑大赏", imgSrc: "https://static-cse.canva.cn/blob/312574/IMG_9198.jpg" },
      { text: "宣传水果", imgSrc: "https://img.shetu66.com/2023/07/11/1689037885708709.png" },
      { text: "双十一来袭", imgSrc: "https://static-cse.canva.cn/blob/26393/IMG_9197.jpg" }
    ],
    // 应用导航数据
    appNavList: [
      { text: "百度热搜", imgSrc: "https://img.ixintu.com/upload/jpg/20210605/b169f21b56a06377cce29ff554b1513e_9729_192_192.jpg!ys" },
      { text: "调查问卷", imgSrc: "https://tse1-mm.cn.bing.net/th/id/OIP-C.bTrguS128kWdopDUMuXV9gHaHa?w=215&h=215&c=7&r=0&o=7&dpr=1.3&pid=1.7&rm=3" },
      { text: "星座运势", imgSrc: "https://ts2.tc.mm.bing.net/th/id/OIP-C.ez9f_A5yQzg37piuidKMwwHaHa?rs=1&pid=ImgDetMain&o=7&rm=3" },
      { text: "随机颜色", imgSrc: "https://img.ixintu.com/download/jpg/202001/29c0a1f690b97bb32597e815869f0980.jpg!con" }
    ],
    // 商品推荐数据
    goodList: [
      { text: "华为三折叠屏手机", price: 20899, imgSrc: "https://img12.360buyimg.com/n1/s450x450_jfs/t1/5738/31/25046/60478/66ed2d5bFa7ab36fb/a857acd4493f7f92.jpg.avif" },
      { text: "HUIWEI X16 pro+", price: 1598, imgSrc: "https://img12.360buyimg.com/n1/s720x720_jfs/t1/322193/11/12002/102624/68a5b48fFddc7b5c5/934ce59b7ab0ae38.jpg.avif" },
      { text: "华为三折叠屏手机", price: 20899, imgSrc: "https://img12.360buyimg.com/n1/s450x450_jfs/t1/5738/31/25046/60478/66ed2d5bFa7ab36fb/a857acd4493f7f92.jpg.avif" },
      { text: "华为三折叠屏手机", price: 20899, imgSrc: "https://img12.360buyimg.com/n1/s450x450_jfs/t1/5738/31/25046/60478/66ed2d5bFa7ab36fb/a857acd4493f7f92.jpg.avif" },
    ],
  },
  // 点击事件
  onTap(e) {
    console.log(e);
  },

  // 生命周期函数
  onLoad(){
    // 获取缓存
    let token = wx.getStorageSync("token")
    console.log(token);
    // 判断内存里面有没有 token
    if( !token ){
      // 跳转登陆页
      wx.reLaunch({
        url:"/pages/login-page/index"
      })
    } 
    // 删除缓存
    // wx.removeStorageSync('token')
  }
})